import {createVNode, render} from "vue";
import TipsDialog from "./TipsDialog.vue";

export const Notify = (option) => {
    const container = document.createElement('div')

    render(createVNode(TipsDialog, {
        ...option,
        onDestroy: () => container.remove(),
    }), container)
    document.body.appendChild(container)
}
const nException = (message) => {
    Notify({
        title: message,
        bgColor: "red",
        icon: "ri-error-warning-line"
    })
}
const nSuccess = (message) => {
    Notify({
        title: message,
        bgColor: "green",
        icon: "ri-check-line"
    })
}
export {nException, nSuccess}
export default Notify
export * from './'